import { CURDApiBase } from '../curd-api-base'
import request from '@/utils/request'

export default new class RoleApi extends CURDApiBase {
  constructor() {
    super('/core/api/role')
  }

  /**获取角色对应的菜单权限 */
  getMenus(id: string) {
    return request({
      url: `${this.baseUrl}/get-menus/${id}`,
      method: 'get'
    })
  }

  /**设置角色对应的权限菜单 */
  setMenus(id: string, data: any): any {
    return request({
      url: `${this.baseUrl}/set-menus/${id}`,
      method: 'put',
      data
    })
  }
}()
